package com.erdos.upc.entity;


import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

import com.erdos.common.entity.AbstractEntity;


public class Privilege extends AbstractEntity implements Serializable{
   /**
	 * 
	 */
	private static final long serialVersionUID = 6491789880588468392L;
private String name;
   private Long type;
   private Long category;
   private String url;
   private String code;
   private String description;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
public Long getType() {
	return type;
}
public void setType(Long type) {
	this.type = type;
}
public Long getCategory() {
	return category;
}
public void setCategory(Long category) {
	this.category = category;
}
public String getUrl() {
	return url;
}
public void setUrl(String url) {
	this.url = url;
}
public String getCode() {
	return code;
}
public void setCode(String code) {
	this.code = code;
}
public String getDescription() {
	return description;
}
public void setDescription(String description) {
	this.description = description;
}
/**
 * equals方法复写
 */
public boolean equals(Object o) {
	if (!(o instanceof Privilege)) {
		return false;
	}
	Privilege p = (Privilege) o;
	return new EqualsBuilder().append(this.getSid(), p.getSid()).isEquals();
}

/**
 * hashCode方法复写
 */
public int hashCode() {
	return new HashCodeBuilder(61, 15).append(this.getSid()).toHashCode();
}




private void writeObject(ObjectOutputStream out) throws IOException {
	out.defaultWriteObject();		        
	out.writeObject(this.getSid());
	out.writeObject(this.getVersion());
	out.writeObject(this.getCreatedBy());
	out.writeObject(this.getCreatedDt());
	out.writeObject(this.getUpdatedBy());
	out.writeObject(this.getUpdatedDt());
}

private void readObject(ObjectInputStream in) throws IOException,
		ClassNotFoundException {
	in.defaultReadObject();
	this.setSid((Long) in.readObject());
	this.setVersion((Integer) in.readObject());
	this.setCreatedBy((String)in.readObject());
	this.setCreatedDt((Date)in.readObject());
	this.setUpdatedBy((String)in.readObject());
	this.setUpdatedDt((Date)in.readObject());
}
}